package cn.com.utt.common.message;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

public class Reboot extends Message {
	@JSONField(name = "replyto")
	private String replyTo;
	@JSONField(name = "delay")
	private int delay;

	public Reboot() {
		setType(MessageType.REBOOT.toString());
	}

	@Override
	public String encode() {
		return JSON.toJSONString(this);
	}

	@Override
	public void decode(byte[] buf) {
		Reboot reboot = JSON.parseObject(buf, Reboot.class);
		this.setId(reboot.getId());
		this.replyTo = reboot.getReplyTo();
		this.delay = reboot.getDelay();
	}


	public String getReplyTo() {
		return replyTo;
	}

	public void setReplyTo(String replyTo) {
		this.replyTo = replyTo;
	}

	public int getDelay() {
		return delay;
	}

	public void setDelay(int delay) {
		this.delay = delay;
	}

}
